<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity4"
      lang="zh-cmn-Hans"
>
<head th:include="include/includebase"></head>
<link th:href="@{/css/stage/bom-stage.css}" rel="stylesheet"/>
<meta charset="UTF-8">
<title>全BOM配置一级清单</title>
<body class="content-body">
<div class="panel-body col-md-12">
    <div class="input-group">
        <button class="btn btn-default" id="myButton" type="button">刷新</button>
        <button class="btn btn-default" id="addVehicle" type="button">添加列信息</button>
        <button class="btn btn-default" id="setVersion" type="button">设置大版本</button>
        <button class="btn btn-default" id="release" type="button">设置小版本</button>
        <button class="btn btn-default" id="setStage" type="button">设置阶段</button>
        <!--<button class="btn btn-default" id="getVwo" type="button">发起流程</button>-->
        <!--<button class="btn btn-default" id="goBackData" type="button">撤销</button>-->
        <button class="btn btn-default" onclick="javascript:table2excel('cfg0Table','全配置BOM一级清单')">导出Excel</button>
    </div>
    <div class="panel panel-default" style="margin-top: 50px;">
        <div class="panel-body col-md-12">
            <form class="form-inline" role="form" style="float: left; width: 100%;margin-left: 20px;" method="post"
                  id="queryLoadBom">
                <div class="form-group">
                    <label for="td_part">总成零件号:</label>
                    <input type="text" class="form-control" name="platforms" id="td_part" placeholder="请输入总成零件号" onfocus="focusQuery(this)"/>
                </div>
                <div class="form-group">
                    <label for="td_cfg">配置代码:</label>
                    <input type="text" class="form-control" name="modelnumber" id="td_cfg" placeholder="请输入配置代码" onfocus="focusQuery(this)"/>
                </div>
                <div class="form-group">
                    <label for="td_model">版型:</label>
                    <input type="text" class="form-control" name="modelyear" id="td_model" placeholder="请输入版型" onfocus="focusQuery(this)"/>
                </div>
                <div class="form-group">
                    <label for="td_cfgmag">配置管理:</label>
                    <input type="text" class="form-control" name="modelyear" id="td_cfgmag" placeholder="请输入配置管理" onfocus="focusQuery(this)"/>
                </div>
                <div class="form-group">
                    <button type="button" id="searchBtn" onclick="query(this)" class="btn btn-primary">搜索</button>
                </div>
            </form>
            <div class="content col-lg-12" style="overflow: auto;max-height: 550px;padding-top:20px ">
                <table class="table table-striped ff-style" id="cfg0Table" style="min-width: 1920px;"></table>
            </div>
        </div>
    </div>

</div>

</body>
<script th:src="@{/js/helper/projectHelper.js}"></script>
<script th:src="@{/js/helper/tableExportToExcle.js}"></script>
<script th:src="@{/js/jquery/jquery.table2excel.min.js}"></script>
<script th:src="@{/js/stage/bom-all-cfg2.js}"></script>
<script th:inline="javascript">
    var focuseId = "";
    var focuseClass = ""
    function doQuery() {
        $("#myButton").trigger('click');
    }
    function focusQuery(self) {
        focuseId = $(self).attr("id");
    }
    function query(but) {
        if(focuseClass!=""){
            $('.' + focuseClass).css("background-color", "#ffffff");
        }
        var focuseVal = $("#"+focuseId).val();
        if(focuseVal!==""&&focuseVal!=null){
            focuseClass = focuseId+"Class";
            $('.' + focuseClass).each(function (index,item) {
                var divText = $(item).text();
                var butText = $("#"+focuseId).val();
                if(divText==butText){
                    var objDom = $(item)[0];
                    objDom.scrollIntoView(true);
                    $(item).css("background-color", "red");
                }
            });
        }
    }
</script>
</html>